<template>
	<view class="add page c00">
		<view class="bgf7 p12">
			<view class="bgff px14 pb10">

				<view class="flex flexC borb py12">
					<text class="flex1">店铺</text>
					<input v-model="data.shop_name" disabled="disable" type="text" class=" aliR  py3"  />
				</view>
				<view class="flex flexC borb py12">
					<text class="flex1">台桌</text>
					<input v-model="data.room_name" disabled="disable" type="text" class=" aliR  py3" />
				</view>
				<view class="flex flexC borb  py12">
					<text class="flex1">续时间时长</text>
					<input value="1" type="number" disabled="disable" class=" aliR  py3" />
				</view>
				<view class="flex flexC  py12">
					<text class="flex1">预计结束时间</text>
					<input v-model="data.end_time" type="text" class=" aliR  py3" />
				</view>

			</view>
			<view class="flex flexC flexJC py20">
				<view class="aliC py12 w-17 bgf6c r40" @click="doDui()">在线续时</view>
			</view>

		</view>

	</view>
</template>

<script>
	export default {
		components: {},
		data() {
			return {

				code: '',
				amount: '',
				shop_name: '',
				id: '',
				data:null

			};
		},
		onLoad(option) {

			this.id = option.id;
			this.getDetail();
		},

		onShow() {

		},
		methods: {

		
			doDui() {


			
				let param = {
					id: this.id

				};
				let that = this;
				this.$api.doTableCommentXu(param).then(res => {
					console.info(JSON.stringify(res));
					if (res.code == 1) {
						
						uni.navigateTo({
							url:'../order/tableDetail?order_no='+res.data
						})
						
					} else {
						uni.showToast({
							title: res.msg,
							icon: "none"
						})
					}
				})
			},

			getDetail() {

				let param = {
					id: this.id
				}
				let that = this;
				this.$api.xuTableCommentDetail(param).then(res => {

					if (res.code == 1) {

						that.data = res.data;

					} else {
						uni.showToast({
							title: res.msg,
							icon: "none"
						})
					}
				})
			},
			save() {



				if (this.mobile == '') {

					uni.showToast({
						title: "请填写手机号",
						icon: 'none'
					})
					return;
				}

				if (this.amount == '') {

					uni.showToast({
						title: "请填写转赠金额",
						icon: 'none'
					})
					return;
				}

				let param = {
					shop_id: this.selectShop.id,
					mobile: this.mobile,
					amount: this.amount,
					password: this.password
				};
				let that = this;
				this.$api.sendMoney(param).then(res => {

					if (res.code == 1) {
						uni.showModal({
							title: "转赠提示",
							content: "转赠成功",
							showCancel: false,
							complete() {
								uni.navigateBack({
									delta: 1
								})
							}
						})
					} else if (res.code == -2) {
						uni.navigateTo({
							url: '../member/paypassword'
						})
					} else {
						uni.showToast({
							title: res.msg,
							icon: 'none'
						})
					}
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	.add {
		.w48 {
			width: 96rpx;
			height: 96rpx;
		}

		.imgbox {
			width: 164rpx;
			height: 164rpx;
			background-color: #E8E8E8;
			position: relative;

			image {
				width: 100%;
				height: 100%;
			}

			.del {
				width: 36rpx;
				height: 36rpx;
				background: rgba(181, 180, 180, .8);
				position: absolute;
				top: -12rpx;
				right: -12rpx;
			}
		}
	}

	.pwdPopup {
		/deep/.uni-popup__wrapper {
			height: 80vh;
		}

		.inpbox {
			position: relative;

			.colse {
				position: absolute;
				top: 0;
				right: 0;
			}
		}
	}

	.popup-content2 {
		background: #FFFFFF;

		.popup-btn {
			width: 100%;
			height: 100rpx;
			line-height: 100rpx;
			text-align: center;
			border-bottom: 1px solid #f5f5f5;
			background: #FFFFFF;
		}

		.button {
			width: 100%;
			height: 100rpx;
			line-height: 100rpx;
			text-align: center;
			border-bottom: 1px solid #f5f5f5;
			background: #FFFFFF;
			font-size: 11pt;
		}

		button::after {
			border: none;
		}

		.pt20 {
			border-bottom: 20rpx solid #f5f5f5;
		}


	}
</style>